//
//  InsuranceReportVC.m
//  HNJYB
//
//  Created by panshen on 2017/10/23.
//  Copyright © 2017年 Mag1cPanda. All rights reserved.
//

#import "InsuranceReportVC.h"
#import "AccidentHeader.h"
//#import "ReportTypeCell.h"
//#import "BXBARightCell.h"
#import "ChooseReportTypeVC.h"
#import "OneTipsViewController.h"

@interface InsuranceReportVC ()
//<UITableViewDataSource,
//UITableViewDelegate>
{
//    UITableView *table;
//    NSArray *iconArr;
//    NSArray *titleArr;
//    NSArray *contentArr;
}

@property (weak, nonatomic) IBOutlet AccidentHeader *header;
@end

@implementation InsuranceReportVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title = @"保险理赔";
    
//    iconArr = @[@"wszz", @"fwzx"];
//    titleArr = @[@"网上自助定损理赔", @"服务中心定损理赔"];
    
    
    _header.icon.image = [UIImage imageNamed:@"IP013"];
    _header.topLab.text = @"请您在保证自身安全的情况下操作";
    _header.bottemLab.text = @"请根据需要选择以下方式定损、理赔";
    
//    table = [[UITableView alloc] initWithFrame:CGRectMake(10, 100, ScreenWidth - 20, ScreenHeight - 164) style:UITableViewStylePlain];
//    table.tableFooterView = [UIView new];
//    table.backgroundColor = HNBackColor;
//    table.delegate = self;
//    table.dataSource = self;
//    table.separatorStyle = UITableViewCellSeparatorStyleNone;
////    [self.view addSubview:table];
    
//    [table registerNib:[UINib nibWithNibName:@"ReportTypeCell" bundle:nil] forCellReuseIdentifier:@"ReportTypeCell"];
//
//    [table registerNib:[UINib nibWithNibName:@"BXBARightCell" bundle:nil] forCellReuseIdentifier:@"BXBARightCell"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark - tableView Delegate & DataSource
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
//{
//    return 2;
//}
//
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
//{
//    return 1;
//}
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    ReportTypeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ReportTypeCell"];
//    cell.selectionStyle = UITableViewCellSelectionStyleNone;
//    cell.icon.image = [UIImage imageNamed:iconArr[indexPath.section]];
//    cell.topLab.text = titleArr[indexPath.section];
//
////    if ((indexPath.row % 2) == 0) {
////
////    }
////
////    else {
////        PZNCCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PZNCCell"];
////        cell.selectionStyle = UITableViewCellSelectionStyleNone;
////        cell.icon.image = [UIImage imageNamed:iconArr[indexPath.section]];
////        cell.contentLab.text = titleArr[indexPath.section];
////    }
//
//    return cell;
//}
//
//-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    return 120;
//}
//
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
//{
//    return 10;
//}
//
//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
//{
//    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth - 20, 10)];
//    view.backgroundColor = HNBackColor;
//    return view;
//}

//-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    if (indexPath.section == 0) {
//        
//    }
//    
//    else {
//        
//    }
//}

- (IBAction)online:(id)sender {
    
    NSMutableDictionary *bean = [NSMutableDictionary dictionary];
    [bean setValue:GlobleInstance.userflag forKey:@"userflag"];
    [bean setValue:GlobleInstance.token forKey:@"token"];
    [bean setValue:GlobleInstance.appcaseno forKey:@"appcaseno"];
    [bean setValue:@"1" forKey:@"reportway"];
    
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    
    [LSHttpManager requestUrl:HNServiceURL serviceName:@"jjappinsreportways" parameters:bean complete:^(id result, ResultType resultType) {
        
        [hud hideAnimated:YES];
        NSLog(@"jjappinsreportways ~ %@",result);
        
        if ([result[@"restate"] isEqualToString:@"1"]) {
            ChooseReportTypeVC *vc = [ChooseReportTypeVC new];
            [self.navigationController pushViewController:vc animated:YES];
        }
        
    }];
    
    
}

- (IBAction)offline:(id)sender {
    
    NSMutableDictionary *bean = [NSMutableDictionary dictionary];
    [bean setValue:GlobleInstance.userflag forKey:@"userflag"];
    [bean setValue:GlobleInstance.token forKey:@"token"];
    [bean setValue:GlobleInstance.appcaseno forKey:@"appcaseno"];
    [bean setValue:@"0" forKey:@"reportway"];
    
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    
    [LSHttpManager requestUrl:HNServiceURL serviceName:@"jjappinsreportways" parameters:bean complete:^(id result, ResultType resultType) {
        
        [hud hideAnimated:YES];
        NSLog(@"jjappinsreportways ~ %@",result);
        
        if ([result[@"restate"] isEqualToString:@"1"]) {
            OneTipsViewController *vc = [OneTipsViewController new];
            vc.tipStr = @"请引导当事人关注微信公众号，选择理赔中心导航前往，进行快速定损理赔";
            [self.navigationController pushViewController:vc animated:YES];
        }
        
    }];
    
    
}


@end
